
    <?php echo $this->Html->script('/admin/js/laydate/laydate.js');?>     
    <div class="margin Competence_style" id="page_style"> 
        <div class="operation clearfix">
            <ul class="choice_search">
                <form role="form" id="userForm" action="/admin/news" method="get">  
                    <li class="clearfix col-xs-2 "><label class="label_name col-xs-1">新闻分类：&nbsp;&nbsp;</label><div class="Add_content col-xs-1">
                        <select name="category_id">  
                            <option value="0">--选择攻略分类--</option>
                            <?php foreach ($cateList as $key => $value) {?> 
                            <option value="<?php echo $value['id'];?>" <?php echo isset($_GET['category_id']) && $_GET['category_id']==$value['id']?'selected':''?>><?php echo $value['name'];?></option> 
                            <?php if(isset($value['_child']) && sizeof($value['_child'])>0){ foreach ($value['_child'] as $kk => $vv) {?> 
                                <option value="<?php echo $vv['id'];?>" <?php echo isset($_GET['category_id']) && $_GET['category_id']==$vv['id']?'selected':''?>>&nbsp;---<?php echo $vv['name'];?></option>
                            <?php }}}?> 
                        </select></div>  
                    </li>  
                    <li class="clearfix col-xs-4 col-lg-5 col-ms-5 "><label class="label_name ">时间：</label> 
                        <input class="laydate-icon col-xs-4 col-lg-3" name="startTime" value="<?= @$_GET['startTime'] ?>" id="start" style=" margin-right:10px; height:28px; line-height:28px; float:left">
                        <span  style=" float:left; padding:0px 10px; line-height:32px;">至</span>
                        <input class="laydate-icon col-xs-4 col-lg-3" name="endTime" id="end" value="<?= @$_GET['endTime'] ?>" style="height:28px; line-height:28px; float:left">
                    </li> 
                    <input name="keywords" type="text" value="<?= @$_GET['keywords'] ?>" placeholder="标题" class="form-control"/>
                    <button class="btn button_btn bg-deep-blue " onclick="this.form.submit()"  type="button"><i class="fa  fa-search"></i>&nbsp;搜索</button> 
                    <a href="/admin/news_edit"  class="btn button_btn bg-deep-blue" title="添加新闻"><i class="fa  fa-edit"></i>&nbsp;添加新闻</a>    
                </form> 
            </ul>  
        </div>
        <div class="compete_list">
            <table id="data_table" class="table table_list table_striped table-bordered dataTable no-footer">
                <thead>
                    <tr>  
                        <th>序号</th>
                        <th>主图</th>  
                        <th>标题</th>   
                        <th>分类</th>  
                        <th>排序</th>    
                        <th>评论数</th>    
                        <th>浏览数</th>    
                        <th>点赞数</th>   
                        <th>状态</th> 
                        <th>首页推荐</th>  
                        <th>发布时间</th> 
                        <th>更新时间</th>  
                        <th class="hidden-480">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($dataList as $key => $v) { ?>
                    <tr>  
                        <td><?php echo $v['New']['id'];?></td>
                        <td><img src="<?php echo $v['New']['image'];?>" width="100px"></td>  
                        <td><a target="_blank" href="/news/info/<?php echo $v["New"]["id"].".html";?>"><?php echo $v['New']['title'];?></a></td>
                        <td><?php echo $v['New']['cate_name'];?></td> 
                        <td><?php echo $v['New']['sort'];?></td>  
                        <td><?php echo $v['New']['comment_num'];?></td>  
                        <td><?php echo $v['New']['browse_num'];?></td>  
                        <td><?php echo $v['New']['agree_num'];?></td>  
                        <td><span  class="<?php echo $v['New']['status']==1?'yesimg':'noimg';?>" onclick="toggle(this,'news', <?php echo $v['New']['id'];?>)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> 
                        <td><span  class="<?php echo $v['New']['is_home']==1?'yesimg':'noimg';?>" onclick="toggle(this,'news_home', <?php echo $v['New']['id'];?>)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>   
                        <td><?= date('Y-m-d H:i:s',strtotime($v['New']['create_time'])) ?></td> 
                        <td><?= date('Y-m-d H:i:s',strtotime($v['New']['update_time'])) ?></td> 
                        <td class="td-manage"> 
                            <a title="编辑" href="/admin/news_edit?id=<?= $v['New']['id']?>" class="btn button_btn bg-deep-blue">编辑</a>
                            <a title="删除" href="javascript:;" onclick="delAct(this,'news',<?php echo $v['New']['id'];?>,'single')" class="btn button_btn btn-danger">删除</a>
                        </td>
                    </tr>
                    <?php }?> 
                </tbody>
            </table>
            <?php echo $this->element('admin/pagination');?>
        </div>
    </div> 

<script type="text/javascript">

/******时间设置*******/
var start = {
    elem: '#start',
    format: 'YYYY-MM-DD',
   // min: laydate.now(), //设定最小日期为当前日期
    max: '2099-06-16', //最大日期
    istime: true,
    istoday: false,
    choose: function(datas){
         end.min = datas; //开始日选好后，重置结束日的最小日期
         end.start = datas //将结束日的初始值设定为开始日
     }
 };
 var end = {
    elem: '#end',
    format: 'YYYY-MM-DD',
    //min: laydate.now(),
    max: '2099-06-16',
    istime: true,
    istoday: false,
    choose: function(datas){
        start.max = datas; //结束日选好后，重置开始日的最大日期
    }
};
laydate(start);
laydate(end);
</script>